using UnityEngine;
using QFramework;
using ProjectSurvivor;
using QAssetBundle;

namespace QFrameworkSurvivor
{
	public partial class Hp : PowerUp
    {
        protected override Collider2D Collider2D => SelfCollider2D;
        private void OnTriggerEnter2D(Collider2D other)
        {
            if (other.GetComponent<CollectableArea>())
            { 
                if(Global.HP.Value<Global.MaxHP.Value)
                {
                    FlyingToPlayer=true;
                }
            }
        }
        protected override void Execute()
        {
            AudioKit.PlaySound(Sfx.HP);
            Global.HP.Value++;
            this.DestroyGameObjGracefully();
        }
    }
}
